package ru.yandex.api.money.oauth;

/**
 * @author: Melnikov Ivan melnikov.ivan@gmail.com
 */
public abstract class Scope {

	public abstract String desc();

	public static Scope accountInfo() {
		return new Scope() {
			public String desc() {
				return "account-info";
			}
		};
	}
	
	public static Scope operationHistory() {
		return new Scope() {
			public String desc() {
				return "operation-history";
			}
		};
	}
	
	public static Scope paymentShop(final int days, final double sum) {
		return new Scope() {
			public String desc() {
				return "payment-shop.limit("+days+","+sum+")";
			}
		};
	}
	
	public static String scopes(Scope...scopes) {
		StringBuilder str = new StringBuilder();
		for(Scope s : scopes) {
			str.append(" "+s.desc());
		}
		return str.toString().substring(1);
	}
}
